<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" class="tl-dialog" width="1200px" @open="open" @close="close" top="10px" :append-to-body="true" :modal-append-to-body="true">
    <div style="padding-bottom:10px">
      <!-- 查询界面 -->
      <tl-list-search ref="search" :query-param="queryParam" @search="doQuery" :isDisplayDefaultSearch="false">
        <template slot="search">
          <el-form-item label="编码" prop="code">
            <el-input v-model="queryParam.qry_code" placeholder=""></el-input>
          </el-form-item>
          <el-form-item label="名称">
            <el-input v-model="queryParam.qry_name" placeholder=""></el-input>
          </el-form-item>
        </template>
      </tl-list-search>
      <!-- 列表界面 -->
      <div>
        <!-- 列表选择 -->
        <div class="table-alert-div" ref="selector">
          <el-alert type="success" :closable="false" class="tl-table-alert-info" effect="light">
            <template slot="title">
              已选择&nbsp;<a class="tl-table-alert-info-a1">{{ selectedRows.length }}</a
              >项&nbsp;&nbsp;
              <a class="tl-table-alert-info-a2" @click="doClearSelected">全部清空</a>
            </template>
          </el-alert>
        </div>
        <!--表格渲染-->
        <el-table class="tl-table" ref="mainTable" :height="tableHeight" v-loading="loading" :data="datas" @selection-change="doSelectChange" @sort-change="doSortChange" @row-dblclick="doRowDbClick" row-key="id" border fit :row-class-name="doChangeRowClassName">
          <el-table-column type="selection" width="55px" fixed="left" v-if="isSingleSelect === false "> </el-table-column>
					<el-table-column prop="docdate" label="单据日期" width="170px" sortable="custom" sort-by="docdate" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="docno" label="单据编号" width="150px" sortable="custom" sort-by="docno" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dispproblemgrading" label="问题分级" width="100px" sortable="custom" sort-by="problemgrading" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dispsourcetype" label="问题来源类型" width="100px" sortable="custom" sort-by="sourcetype" align="center" header-align="center"></el-table-column>
					<el-table-column prop="sourcedocno" label="问题来源单号" width="150px" sortable="custom" sort-by="sourcedocno" align="center" header-align="center"></el-table-column>
					<el-table-column prop="productname" label="产品名称" width="150px" sortable="custom" sort-by="productname" align="center" header-align="center"></el-table-column>
					<el-table-column prop="hardwareversion" label="硬件版本" width="150px" sortable="custom" sort-by="hardwareversion" align="center" header-align="center"></el-table-column>
					<el-table-column prop="softwareversion" label="软件版本" width="150px" sortable="custom" sort-by="softwareversion" align="center" header-align="center"></el-table-column>
					<el-table-column prop="mesbarcode" label="MES条码" width="150px" sortable="custom" sort-by="mesbarcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="disphappennode" label="问题发生环节" width="100px" sortable="custom" sort-by="happennode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="classes" label="工序/实验类别" width="150px" sortable="custom" sort-by="classes" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dispipdnode" label="IPD节点" width="100px" sortable="custom" sort-by="ipdnode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="disprequirements" label="需求包" width="100px" sortable="custom" sort-by="requirements" align="center" header-align="center"></el-table-column>
					<el-table-column prop="disppathway" label="信息途径" width="100px" sortable="custom" sort-by="pathway" align="center" header-align="center"></el-table-column>
					<el-table-column prop="warningtitle" label="告警主题" width="150px" sortable="custom" sort-by="warningtitle" align="center" header-align="center"></el-table-column>
					<el-table-column prop="problemdesc" label="问题描述" width="150px" sortable="custom" sort-by="problemdesc" align="center" header-align="center"></el-table-column>
					<el-table-column prop="rejects" label="不良情况" width="150px" sortable="custom" sort-by="rejects" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dispemergenttreatment" label="紧急处理方式" width="100px" sortable="custom" sort-by="emergenttreatment" align="center" header-align="center"></el-table-column>
					<el-table-column prop="disprepeat" label="是否重复发生" width="100px" sortable="custom" sort-by="repeat" align="center" header-align="center"></el-table-column>
					<el-table-column prop="productline" label="问题归属产品线" width="120px" sortable="custom" sort-by="productline" align="center"></el-table-column>
					<el-table-column prop="productlinename" label="问题归属产品线名称" width="150px" sortable="custom" sort-by="productlinename" align="center" header-align="center"></el-table-column>
					<el-table-column prop="productlineusercodes" label="问题归属专员" width="150px" sortable="custom" sort-by="productlineusercodes" align="center" header-align="center"></el-table-column>
					<el-table-column prop="productlineusernames" label="问题归属专员名称" width="150px" sortable="custom" sort-by="productlineusernames" align="center" header-align="center"></el-table-column>
					<el-table-column prop="othermails" label="问题提醒额外收件箱" width="150px" sortable="custom" sort-by="othermails" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dutydeptid" label="牵头分析部门" width="120px" sortable="custom" sort-by="dutydeptid" align="center"></el-table-column>
					<el-table-column prop="dutydeptname" label="牵头分析部门名称" width="150px" sortable="custom" sort-by="dutydeptname" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dutyusercodes" label="牵头分析专员" width="150px" sortable="custom" sort-by="dutyusercodes" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dutyusernames" label="牵头分析专员名称" width="150px" sortable="custom" sort-by="dutyusernames" align="center" header-align="center"></el-table-column>
					<el-table-column prop="reviewman" label="复核人姓名" width="120px" sortable="custom" sort-by="reviewman" align="center"></el-table-column>
					<el-table-column prop="reviewmancode" label="复核人工号" width="150px" sortable="custom" sort-by="reviewmancode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="riskman" label="风险排查负责人" width="120px" sortable="custom" sort-by="riskman" align="center"></el-table-column>
					<el-table-column prop="riskmancode" label="风险排查负责人工号" width="150px" sortable="custom" sort-by="riskmancode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="assayer" label="问题分析负责人" width="120px" sortable="custom" sort-by="assayer" align="center"></el-table-column>
					<el-table-column prop="assayercode" label="问题分析负责人工号" width="150px" sortable="custom" sort-by="assayercode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="cancelreason" label="作废原因" width="150px" sortable="custom" sort-by="cancelreason" align="center" header-align="center"></el-table-column>
					<el-table-column prop="orgname" label="申请公司" width="120px" sortable="custom" sort-by="orgname" align="center"></el-table-column>
					<el-table-column prop="orgcode" label="申请公司编码" width="150px" sortable="custom" sort-by="orgcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="deptname" label="申请部门" width="120px" sortable="custom" sort-by="deptname" align="center"></el-table-column>
					<el-table-column prop="deptcode" label="申请部门编码" width="150px" sortable="custom" sort-by="deptcode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="username" label="申请人姓名" width="120px" sortable="custom" sort-by="username" align="center"></el-table-column>
					<el-table-column prop="usercode" label="申请人工号" width="150px" sortable="custom" sort-by="usercode" align="center" header-align="center"></el-table-column>
					<el-table-column prop="submitdate" label="提交时间" width="170px" sortable="custom" sort-by="submitdate" align="center" header-align="center" :formatter="dateTimeFormat"></el-table-column>
					<el-table-column prop="dispflowid" label="审批流程" width="100px" sortable="custom" sort-by="flowid" align="center" header-align="center"></el-table-column>
					<el-table-column prop="dispstate" label="状态" width="100px" sortable="custom" sort-by="state" align="center" header-align="center"></el-table-column>
					<el-table-column prop="latestphase" label="最新阶段" width="150px" sortable="custom" sort-by="latestphase" align="center" header-align="center"></el-table-column>
					<el-table-column prop="description" label="备注" min-width="250px" align="left" header-align="center"></el-table-column>
					<el-table-column prop="enabled" label="有效" width="100px" sortable="custom" sort-by="enabled" align="center" header-align="center">
						<template slot-scope="scope">
							<el-tag v-if="scope.row.enabled === 1" type="success">是</el-tag>
							<el-tag v-else type="danger">否</el-tag>
						</template>
					</el-table-column>
          <el-table-column label="操作" width="80px" align="center" fixed="right" v-if="isSingleSelect === true">
            <template slot-scope="scope">
              <el-button type="text" icon="el-icon-finished" @click="doSelectData(scope.row[fieldDefaultKey])">选择</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!-- 列表分页 -->
        <el-row class="pagebar" ref="pager">
          <el-pagination @size-change="doChangeSize" @current-change="doChangeIndex" :current-page="pageInfo.currentPage" :page-sizes="pageInfo.pageSizes" :total="pageInfo.totalCount" layout="total, sizes, prev, pager, next, jumper" background class="tl-table-pagination"> </el-pagination>
        </el-row>
      </div>
    </div>
    <div slot="footer" class="dialog-footer" v-if="isSingleSelect === false">
      <el-button type="text" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doConfirm">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_ref_list } from '@tapui/mixins/mixin_ref_list'
/** 子组件 */
/** 工具类 */
import { queryDataCode } from '@tapui/api/dataCode'
import { getAction, putAction, postAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  name: 'TlQemProblemAlertRef',
  components: {},
  mixins: [mixin_ref_list],
  data() {
    return {
      description: '问题告警表参照页面',
      // 默认Key字段名
      fieldDefaultKey: 'id',
      // 默认显示字段名
      fieldDefaultValue: 'name',
      // url配置
      url: {
        list: '/qms/qemProblemAlert/refList'
      },
      // 排序参数
      sorterInfo: {
        sidx: 'sortcode',
        sord: 'asc'
      }
    }
  },
  methods: {}
}
</script>

